package com.egao.common.module.student.entity;

import cn.hutool.core.date.DatePattern;
import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

/**
 * 学生信息记录
 *
 * @author lym
 */
@ApiModel(description = "学生信息记录")
@TableName("student_record")
@Data
public class StudentRecord implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty("主键")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty("学生ID")
    private Integer studentId;

    @ApiModelProperty("记录类型 生源 网签")
    private String type;

    @ApiModelProperty("操作")
    private String oper;

    @ApiModelProperty("操作说明")
    private String content;

    @ApiModelProperty("操作人")
    private Integer userId;

    @ApiModelProperty("添加时间")
    @JsonFormat(pattern = DatePattern.NORM_DATETIME_MINUTE_PATTERN)
    private Date createTime;

    @ApiModelProperty("编辑时间")
    private Date updateTime;

    @ApiModelProperty("逻辑删除 0正常 1删除")
    @TableLogic
    private Integer deleted;

    @ApiModelProperty("操作人姓名")
    @TableField(exist = false)
    private String username;

    public StudentRecord() {

    }

    /**
     * 含参实例化对象
     * @param userId 操作人
     * @param studentId 学生ID
     * @param type 记录类型
     * @param oper 具体操作
     */
    public StudentRecord(Integer userId, Integer studentId, String type, String oper) {
        this.userId = userId;
        this.studentId = studentId;
        this.type = type;
        this.oper = oper;
    }

    /**
     * 含参实例化对象
     * @param userId 操作人
     * @param studentId 学生ID
     * @param type 记录类型
     * @param oper 具体操作
     * @param content 操作说明
     */
    public StudentRecord(Integer userId, Integer studentId, String type, String oper, String content) {
        this.userId = userId;
        this.studentId = studentId;
        this.type = type;
        this.oper = oper;
        this.content = content;
    }
}
